< previous page page_628 next page >

Page 628
a practical standpoint rather than a theoretical standpoint.Here you focus on two particular questions: What are the rules? How can these rules help me improve my Visual Basic database applications? To start, let's develop a working definition of data normalization and talk about why it can improve your Visual Basic applications.
What Is Data Normalization?
Data normalization is a process of refining database structures to improve the speed at which data can be accessed and to increase database integrity. This is not easy. Very often, optimizing a table for speed is not the same as optimizing for integrity. Putting a database together involves discovering the data elements you need and then creating a set of tables to hold those elements. The tables and fields you define make up the structure of the database. The structure you decide upon affects the performance of your database programs. Some database layouts can improve access speed. For example, placing all related information in a single table allows your programs to locate all needed data by looking in one place. On the other hand, you can lay out your database in a way that improves data integrity. For example, placing all the invoice line item data in one table and the invoice address information in another table prevents users from deleting complete addresses when they remove invoice line items from the database. Well-normalized databases strike a balance between speed and integrity.
High-speed tables have few index constraints and can have several, sometimes repetitive, fields in a single record. The few constraints make updates, insertions, and deletions faster. The repetitive fields make it easier to load large amounts of data in a single SQL statement instead of finding additional, related data in subsidiary tables linked through those slower index constraints.
Databases built for maximum integrity have many small data tables. Each of these tables can have several indexesmostly foreign keys referencing other tables in the database. If a table is built with high integrity in mind, it is difficult to add invalid data to the database without firing off database error messages. Of course, all that integrity checking eats precious ticks off the microchip clock.
Good data normalization results in data tables that make sense in a fundamental way. Well-normalized tables are easy to understand when you look at them. It is easy to see what kind of data they store and what types of updates need to be performed. Usually, it is rather easy to create data entry routines and simple reports directly from well-normalized tables. In fact, the rule of thumb is this: If it's hard to work with a data table, it probably needs more normalization work.
For the rest of this lesson, you use the Visdata application to build data tables. If you have not already looked at the lesson on Day 7, turn there first for information on how to use Visdata to maintain relational databases.

 
< previous page page_628 next page >

If you like this book, buy it!